// var OSS = require('ali-oss');
import OSS from "ali-oss";
export function client(){

//   LTAIDcsxnkqbyRdk
// EHrKZe3leOy7epF2x46sypL18Ropy2
// ejartest.oss-cn-chengdu.aliyuncs.com
// ejarwebtools.oss-cn-hangzhou.aliyuncs.com
  var client = new OSS({
      region:'oss-cn-hangzhou',//oss-cn-hangzhou
      secure:true,
      endpoint: 'oss-cn-hangzhou.aliyuncs.com',//填写Bucket所在地域 oss-cn-hangzhou.aliyuncs.com
      accessKeyId: 'LTAIDcsxnkqbyRdk',
      accessKeySecret: 'EHrKZe3leOy7epF2x46sypL18Ropy2',
      bucket: 'ejarwebtools',// 填写Bucket名称。ejarwebtools
  })  //后端提供数据
  return client
}
/**
 * 生成随机uuid
 */
export const getFileNameUUID = () => {
  function rx() {
    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
  }
  return `${+new Date()}_${rx()}${rx()}`
}

